<?php 
require_once("action/sys_conf.inc");
if(isset($_GET[sid])){
	$sid = $_GET[sid];
	$link_id = mysql_connect($DBHOST,$DBUSER,$DBPWD);
	mysql_select_db($DBNAME);
	mysql_query("SET NAMES 'utf8'");
	$sql = "select id,name,amount from extpollitems where subjectId='$sid' order by id desc";
	$result = mysql_query($sql);

	if(!mysql_num_rows($result)){
		echo "Sorry,目前没有数据";
		exit;
	}
	else{
	
?>
<table id="table_option" width="50%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
  <tr class="thead">
    <th scope="col">序号</th>
    <th scope="col">名称</th>
    <th scope="col">得票数</th>
    <th scope="col">详细内容</th>
    <th scope="col">操作</th>
  </tr>
	<?php 
	while($option = mysql_fetch_assoc($result)){ 
		$id = $option[id];
		$name =  $option[name];
		$amount = $option[amount];	
	?>
  <tr align="center" id="option_<?php echo $id ?>" class="option">
    <td><?php echo $id ?></td>
    <td><?php echo $name ?></td>
    <td><?php echo $amount ?></td>
    <td><a href="javascript:void(0)" onclick="javascript:iframe(1,'poll_option_detail.php?id=<?php echo $id?>')">查看</a></td>
    <td><a href="javascript:void(0)" onclick="javascript:iframe(1,'poll_option_add.php?oid=<?php echo $id?>')">编辑</a>&emsp;&emsp;<a href="javascript:void(0)" onclick="javascript:delPoll('option',<?php echo $id ?>)">删除</a></td>
  </tr>
	<?php } ?>
</table>
<?php }} ?>